1. Field of the Invention
The present invention relates generally to software compilers and linkers, and more particularly to software compilers and linkers for compiling object-oriented computer programs.
2. Related Art
For object-oriented computer systems to be ultimately successful, software developers must be able to make compatible modifications to class definitions and implementations without requiring consumers of that class to recompile their code. The separation of interface and implementation allowed by object-oriented programming languages makes it theoretically possible to do just that. Unfortunately, when confronted with the need to provide reasonable performance, most object-oriented system developers do not strictly adhere to the separation between class interface and implementation. In the resulting object-oriented systems, the barrier between class interface and implementation is broken down, such that class implementation details are exposed to consumers.
In object-oriented systems where class implementation details are exposed to consumers, it is not possible to support modifications to shared libraries without obsoleting consumers of these libraries. Furthermore, costly recompilations are needed whenever a class definition is changed. This is especially true of conventional C++ environments. C++ is a well known object-oriented computer programming language. For illustrative purposes, the following discussion focuses on C++ systems, although the underlying concepts and principles apply to other object-oriented systems.
C++ computer systems expose the implementation of classes to consumers of the classes by resolving class layout and function binding at compile time. The effect of doing compile-time class layout is magnified by exposing the data-members of a class, either directly or through the use of inline member functions which access data members. While this violates the tenets of pure object-oriented programming practice, accessing data members directly is essential in achieving satisfactory performance in many applications.
The problems associated with conventional object-oriented computer systems, and in particular C++ computer systems, are further discussed below.